package com.example.controller;

import com.example.common.AppResult;
import com.example.exception.ApplicationException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:测试环境代码
 * User: bjc
 * Date: 2025-09-01
 * Time: 19:47
 */
@RestController
//@RequestMapping("/test")
public class TestController {
    //@RequestMapping("/hello")
    public String hello(){
        return "hello world";
    }
    //测试异常环境
    //@GetMapping("/exception")
    public AppResult testException() throws Exception{
        throw new Exception("这是一个Exception");
    }
    //@GetMapping("/applicationException")
    public AppResult testApplicationException() throws ApplicationException {
        throw new ApplicationException("这是一个ApplicationException");
    }
}
